#pragma once
#include <winsock.h>
#include "ws-util.h"

ref class SilhouetteServer
{
public:
	// Constructor
	SilhouetteServer(void);
	// Deconstructor
	~SilhouetteServer(void);

	// Setup server to listen for incoming connections
	void SilhouetteServer::setup(void);

	// Wait until client is connected
	void SilhouetteServer::WaitForConnection(void);

	// Transfers a silhouette to the client
	bool SilhouetteServer::TransferImage(IplImage* image);

	// Checks if the client requested a recalibration
	bool SilhouetteServer::CheckRecalibration(void);

private:
	
	static const int kBufferSize = 1024;
	
	// Connection parameters
	static const int tcpPort = 4444;
	static const char* tcpHost = "127.0.0.1";

	// Prototypes
	SOCKET SilhouetteServer::SetUpListener(const char* pcAddress, int nPort);
};
